<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>后台管理面板</title>
  <!-- 告诉浏览器该页面是自适应布局 -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
   {include file="index/top" /}
   <!--引入JS-->
  <script type="text/javascript" src="/static/plugins/webuploader-0.1.5/webuploader.js"></script>
  <script type="text/javascript">
    //多图删除
	$(document).on('click','.remove_images',function(){
		var remove = $(this).parent().parent(); 
			remove.remove();
	})
  </script>
  {include file="index/webuploader" /}
</head>
<body class="hold-transition skin-blue sidebar-mini">	
<div class="wrapper">
    <div class="content-wrapper" style="margin-left: 0 !important;">
        <!--页眉-->
        <section class="content-header">
          <h1>系统设置</h1>
        </section>
        <!--内容开始-->
        <section class="content">
            <!--数据表开始-->
            <div class="row">
                <div class="col-xs-12">
                  <div class="box">
                    <div class="box-header">
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                     <div class="nav-tabs-custom">
                        <ul class="nav nav-tabs">
                          {volist name="systemGroup" id="vo"}
                          <li {if $key+1 == 1}class="active"{/if}><a href="#tab_{$key+1}" data-toggle="tab" aria-expanded="false">{$vo.name}</a></li>
                          {/volist} 
                        </ul>
                        <form method="post" action="{:url('systemPost')}">
                            <div class="tab-content">
                              <!--循环所有分组-->
                              {foreach $systemGroup as $key=>$vo } 
                              <div class="tab-pane {if $key+1 == 1}active{/if}" id="tab_{$key+1}">
                                <!--调用该分组下所有字段-->
                                {if array_key_exists($vo.id,$system)}<!--去除状态为隐藏的分组配置信息-->
                                {foreach $system[($key+1)] as $k=>$v } 
                                {if $v['status']}<!--去除状态为隐藏的配置信息-->
                                    {if $v['type'] =='text'}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                            <input type="text" name="{$v.field}" class="form-control" placeholder="请输入{$v.name}" value="{$v.value}">
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='textarea'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <div class="col-xs-12 col-sm-8 col-md-6 col-lg-5">
                                          <label class="text-lable">{$v.name}</label>
                                          <textarea class="form-control" name="{$v.field}" rows="3" placeholder="请输入{$v.name}">{$v.value}</textarea>
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='editor'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <div class="col-xs-12 col-sm-8 col-md-6 col-lg-5">
                                          <label class="text-lable">{$v.name}</label>
                                          {:make_editor($v.field,$v.value)}
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='select'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                            <select name="{$v.field}" class="form-control" >
                                            	<option value='' >请选择</option>
                                                {foreach $v.setup.options as $kk=>$vv }
                                                <option {if $v.value == trim($vv.1)}selected{/if} value='{$vv.1}' >{$vv.0}</option>
                                                {/foreach}
                                          	</select>
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='radio'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                          <div class="dd_radio_lable_left">
                                          {foreach $v.setup.options as $kk=>$vv }
                                            <label class="dd_radio_lable">
                                              <input type="radio" name="{$v.field}" value="{$vv.1}" class="dd_radio" {if $v.value == trim($vv.1)}checked{/if}><span>{$vv.0}</span>
                                               
                                            </label>
                                            {/foreach}
                                            </div>
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='checkbox'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                          <div class="dd_radio_lable_left">
                                          {foreach $v.setup.options as $kk=>$vv }
                                            <label class="dd_radio_lable">
                                               <input type="checkbox" name="{$v.field}[]" value="{$vv.1}" class="dd_radio"
                                              {in name="$vv.1" value="$v.value"}checked{/in}
                                               ><span>{$vv.0}</span>
                                               
                                            </label>
                                            {/foreach}
                                            </div>
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    {elseif $v['type'] =='image'/}
                                    <!---->
                                     <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-7 col-sm-6 col-md-4 col-lg-4">
                                            <input type="text" name="{$v.field}" class="form-control" placeholder="请点击按钮上传或手动输入地址" value="{$v.value}">
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">
                                            <!--上传图片-->
                                            <!--用来存放item-->
                                            <div id="fileList_{$v.field}" class="uploader-list">
                                            </div>
                                            <div id="filePicker_{$v.field}"><i class="fa fa-upload m-r-10"></i>选择图片</div>
                                            <img class="image_preview" src="{$v['value'] ? $v['value'] : '/static/admin/images/nopic.png'}" id="image_preview_{$v.field}">
                                            <!--上传图片-->
                                            {eq name="$v.required" value="1"}<span class="image_preview"> *</span>{/eq}
                                          </div>
                                        </div>
                                    </div>
                                    <script>webupload('fileList_{$v.field}','filePicker_{$v.field}','image_preview_{$v.field}','{$v.field}',false ,'{$v.setup.upload_allowext}');	</script>
                                    
                                    {elseif $v['type'] =='file'/}
                                    <!---->
                                     <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-7 col-sm-6 col-md-4 col-lg-4">
                                            <input type="text" name="{$v.field}" class="form-control" placeholder="请点击按钮上传或手动输入地址" value="{$v.value}">
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">
                                            <!--上传文件-->
                                            <!--用来存放item-->
                                            <div id="fileList_{$v.field}" class="uploader-list">
                                            </div>
                                            <div id="filePicker_{$v.field}"><i class="fa fa-upload m-r-10"></i>选择文件</div>
                                            <img class="image_preview" src="{$v['value'] ? $v['value'] : '/static/admin/images/nopic.png'}" id="image_preview_{$v.field}">
                                            <!--上传文件-->
                                            {eq name="$v.required" value="1"}<span class="image_preview"> *</span>{/eq}
                                          </div>
                                        </div>
                                    </div>
                                    <script>webupload('fileList_{$v.field}','filePicker_{$v.field}','image_preview_{$v.field}','{$v.field}',false ,'{$v.setup.upload_allowext}');	</script>
                                    {elseif $v['type'] =='datetime'/}
                                    <!---->
                                    <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                            <input type="text" name="{$v.field}" class="form-control" placeholder="请输入{$v.name}" value="{if $v.value}{$v.value|date="Y-m-d H:i"}{else/}{/if}" id="datepicker_{$v.field}">
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">{if $v['required']==1}*{/if} {$v.tips}</div>
                                        </div>
                                    </div>
                                    <script>
									$(function(){
										$('#datepicker_{$v.field}').datetimepicker({
										  autoclose: 1,
										  format:"yyyy-mm-dd hh:ii:ss",
										  language: "zh-CN",
										  todayHighlight: 1,//今天高亮
										})	
									})
									</script>
                                    {elseif $v['type'] =='template'/}
                                    <!---->
                                     <div class="row dd_input_group">
                                        <div class="form-group">
                                          <label class="col-xs-4 col-sm-2 col-md-2 col-lg-1 control-label dd_input_l">{$v.name}</label>
                                          <div class="col-xs-8 col-sm-6 col-md-4 col-lg-4">
                                            <select name="{$v.field}" class="form-control">
                                                {volist name="template" id="voo"}
                                                <option {if $v['value']==$voo}selected{/if} value="{$voo}">{$voo}</option>
                                                {/volist}
                                            </select>
                                          </div>
                                          <div class="col-xs-12 col-sm-4 col-md-6 col-lg-6 dd_ts">* PC , MOBILE 等都会在该模板中</div>
                                        </div>
                                    </div>
                                    {/if}
                                    <!---->
                                {/if}    
                                {/foreach}
                                {/if}
                              </div>
                              {/foreach}
                              <!-- /.tab-pane -->
                            </div>
                        	<div class="row dd_input_group">
			                	<div class="form-group">
				                  <div class="col-xs-12 col-sm-8 col-md-6 col-lg-5 text-center">
				                    	<button type="submit" class="btn btn-flat btn-primary ">提 交</button> 
				                    	<button type="button" class="btn btn-flat btn-default" onclick="javascript :history.back(-1)">返 回</button>
				                  </div>
		
				                </div>
			                </div>
                        </form>
                        <!-- /.tab-content -->
                      </div>
                    </div>
                    <!-- /.box-body -->
                  </div>
                  <!-- /.box -->
                </div>
              </div>
            <!--数据表结束-->
        </section>
        <!-- right col -->
      </div>
      <!-- /.row (main row) -->

    </section>
        <!--内容结束-->
    </div>
</div>
{include file="index/bottom" /} 

</body>
</html>    